<?php if ($this->geterror):?>
<div class="alert alert-block alert-error">
    <button type="button" class="close" data-dismiss="alert">&times;</button>
    <h4>出错啦, 请检查以下错误项！</h4>
    <?= $this->geterror?>
</div>
<?php endif;?>

<div id="view-content">

	<div class="span12">
	
	<div class="row-fluid" id="register">

		
		<span class="reg_right">
		
		<h4 class="text-center">注册新账号</h4>
            <ul class="nav nav-tabs">
                <li <?php if ($this->type == 1):?>class="active"<?php endif;?>><a href="<?= $this->url(array('controller'=>'member','action'=>'register','type'=>1),null,true)?>" >我是个人</a></li>
                <li <?php if ($this->type == 2):?>class="active"<?php endif;?>><a href="<?= $this->url(array('controller'=>'member','action'=>'register','type'=>2),null,true)?>" >我是商家</a></li>
            </ul>
		
    		<div class="tab-content">
                <div class="tab-pane active" id="personal">
                    <form class="form-horizontal" method="post" action="" name="">
                        <div class="control-group fenge">
                            <small># 账号相关( <em>*</em> 项目为<b>必填</b>项目)</small>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="inputUsername"><em>*</em> <b>用户名</b></label>
                            <div class="controls">
                                <input type="text" id="inputUsername" placeholder="请输入您希望的用户名" name="username" tabindex="1">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="inputPassword"><em>*</em> <b>设置密码</b></label>
                            <div class="controls">
                                <input type="password" id="inputPassword" placeholder="请输入您希望设置的密码" name="password" tabindex="1">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="inputPasswordagain"><em>*</em> <b>确认密码</b></label>
                            <div class="controls">
                                <input type="password" id="inputPasswordagain" placeholder="请再次输入您的密码" name="passwordagain" tabindex="1">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="inputEmail"><em>*</em> <b>电子邮箱</b></label>
                            <div class="controls">
                                <input type="text" id="inputEmail" placeholder="请输入您的电子邮箱" name="email" tabindex="1">
                            </div>
                        </div>
                        
                        <?php if ($this->type == 2):?>
                        <br />
                        <div class="control-group fenge">
                            <small># 公司相关(认真填写您的信息,让用户更喜欢)</small>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="inputConame"><em>*</em> 公司名称</label>
                            <div class="controls">
                                <input type="text" id="inputConame" placeholder="请输入您的公司名称" name="coname" tabindex="1" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="inputAddress"><em>*</em> 公司地址</label>
                            <div class="controls">
                                <input type="text" id="inputAddress" placeholder="请输入您的公司地址" name="address" tabindex="1" />
                            </div>
                        </div>
                        <div class="control-group fenge">
                            <small># 认证相关(以下是<b>可选的</b>,且仅用于认证、我们会严格保密此信息)</small>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="inputName">真实姓名</label>
                            <div class="controls">
                                <input type="text" id="inputName" placeholder="请输入您的真实姓名" name="realname" tabindex="1" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="inputIDno">身份证号</label>
                            <div class="controls">
                                <input type="text" id="inputIDno" placeholder="请输入您的身份证号" name="idno" tabindex="1" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="inputPhone">手机号码</label>
                            <div class="controls">
                                <input type="text" id="inputPhone" placeholder="请输入您的手机号码" name="phone" tabindex="1" />
                            </div>
                        </div>
                        <div class="control-group fenge">
                            <small># 安全相关(以下是<b>可选的</b>,在您忘记密码时为您提供服务)</small>
                        </div>
                        <div class="control-group">
            			    <label for="inputanswer" class="control-label">安全提问</label>
                			<div class="controls">
                				<select name="question">
                					<option value="" selected="">请选择一个安全问题</option>
                					<?php foreach ($this->question[question_arr] as $value):?>
                					<option value="<?= $value[id]?>"><?= $value[name]?></option>
                                    <?php endforeach;?>
                				</select>
                			</div>
            		    </div>
                        <div class="control-group">
                			<label for="inputanswer" class="control-label">安全回答</label>
                			<div class="controls">
                				<input type="text" name="answer" placeholder="请输入您的答案" id="inputanswer" tabindex="1" />
                			</div>
                		</div>
                		<?php endif;?>
                        
                        <hr />
                        <div class="control-group">
                            
                            <div class="controls">
                                <a href="javascript:getCaptcha();" id="captcha" ><img src="/img/loading.gif" title="看不清? 点击换一张" alt="正在生成验证图片" /></a>
                                <p><small><em>*</em> 输入您看到的字符 <a href="javascript:getCaptcha();">[换一张]</a></small></p>
                                <input type="text" name="captcha" value="" placeholder="请输入验证字符" autocomplete="off" tabindex="1" />
                            </div>
                        </div>
                        
                        <div class="control-group">
                            <div class="controls">
                                   <label class="checkbox">
                    		           <input type="checkbox"  checked="" name="agreement" value="1" > 我同意并接受<a href="<?= $this->url(array('controller'=>'service','cat'=>'terms-of-service'),null,true)?>" target="_blank">淘车乐网站服务条款</a>
                    		       </label>
                                <button type="submit" class="btn btn-danger btn-large" id="register_sub" >&nbsp;&nbsp;立即注册&nbsp;&nbsp;</button>
                            </div>
                        </div>
                        <input type="hidden" value="<?= $this->type?>" name="type" id="type" />
                        <input type="hidden" value="1" name="submod" />
                        <input type="hidden" value="<?= $this->ref?>" name="ref" />
        		    </form>
                </div>
                
                <hr />
                <p class="text-right"><i class="icon-question-sign"></i> <a href="<?= $this->url(array('controller'=>'member','action'=>'login'),null,true)?>">已有账号? 立即登陆!</a></p>
                <p><small>* 注册成功后, 您可以使用 用户名/手机号码/电子邮箱 其中任意一种方式(如果您已经设置了这些项目)进行登陆!</small></p>
                <?php if ($this->type == 2):?><p><small>* 填写认证信息后会自动提交审核,淘车乐客服会在三个工作日完成审核!</small></p><?php endif;?>
            </div>
            

		</span>
	
	</div>
	
	</div>

</div>